#ifndef COMMSIGNAL_H
#define COMMSIGNAL_H

#include <QObject>

#define GUI_SIG_START           0x1001
#define GUI_SIG_STOP            0x1002
#define GUI_SIG_PAUSE           0x1003
#define GUI_SIG_AUTO_TO_MANUAL  0x1004
#define GUI_SIG_MANUAL_TO_AUTO  0x1005
#define GUI_SIG_INI     GUI_SIG_START
#define GUI_SIG_END     GUI_SIG_MANUAL_TO_AUTO

#define ROS_SIG_STEP1_COMPLETED 0x2001
#define ROS_SIG_STEP2_COMPLETED 0x2002
#define ROS_SIG_STEP3_COMPLETED 0x2003
#define ROS_SIG_STEP4_COMPLETED 0x2004
#define ROS_SIG_STEP5_COMPLETED 0x2005
#define ROS_SIG_STEP6_COMPLETED 0x2006
#define ROS_SIG_SWITCHED_AUTO   0x2007
#define ROS_SIG_SWITCHED_MANUAL 0x2008
#define ROS_SIG_AUTO_START      0x2009
#define ROS_SIG_AUTO_STOP       0x200A
#define ROS_SIG_AUTO_PAUSE      0x200B
#define ROS_SIG_STATUS_UPDATE   0x200C
#define ROS_SIG_INI     ROS_SIG_STEP1_COMPLETED
#define ROS_SIG_END     ROS_SIG_STATUS_UPDATE

#define GUI_ROS_TEST_SIG_STEP1  0x3001
#define GUI_ROS_TEST_SIG_STEP2  0x3002
#define GUI_ROS_TEST_SIG_STEP3  0x3003
#define GUI_ROS_TEST_SIG_STEP4  0x3004
#define GUI_ROS_TEST_SIG_STEP5  0x3005
#define GUI_ROS_TEST_SIG_STEP6  0x3006
#define GUI_ROS_TEST_SIG_AUTO_TO_MANUAL 0x3007
#define GUI_ROS_TEST_SIG_MANUAL_TO_AUTO 0x3008
#define GUI_ROS_TEST_SIG_AUTO_START 0x3009
#define GUI_ROS_TEST_SIG_AUTO_STOP  0x300A
#define GUI_ROS_TEST_SIG_AUTO_PAUSE 0x300B
#define GUI_ROS_TEST_SIG_STATUS_UPDATE 0x300C
#define GUI_ROS_TEST_SIG_INI    GUI_ROS_TEST_SIG_STEP1
#define GUI_ROS_TEST_SIG_END    GUI_ROS_TEST_SIG_STATUS_UPDATE

#define GUI_SIG_GRIPPER_OPEN_L  0x4001
#define GUI_SIG_GRIPPER_CLOSE_L 0x4002
#define GUI_SIG_GRIPPER_OPEN_R  0x4003
#define GUI_SIG_GRIPPER_CLOSE_R 0x4004
#define GUI_SIG_GRIPPER_INI GUI_SIG_GRIPPER_OPEN_L
#define GUI_SIG_GRIPPER_END GUI_SIG_GRIPPER_CLOSE_R

#define GUI_SIG_MOVE_F      0x5001
#define GUI_SIG_MOVE_B      0x5002
#define GUI_SIG_MOVE_L      0x5003
#define GUI_SIG_MOVE_R      0x5004
#define GUI_SIG_ROBOT_EN    0x5005
#define GUI_SIG_ROBOT_DIS   0x5006
#define GUI_SIG_MOVE_INI    GUI_SIG_MOVE_F
#define GUI_SIG_MOVE_END    GUI_SIG_ROBOT_DIS

#define GUI_SIG_ARM_XI_L    0x6001
#define GUI_SIG_ARM_XD_L    0x6002
#define GUI_SIG_ARM_YI_L    0x6003
#define GUI_SIG_ARM_YD_L    0x6004
#define GUI_SIG_ARM_ZI_L    0x6005
#define GUI_SIG_ARM_ZD_L    0x6006
#define GUI_SIG_ARM_RXI_L   0x6007
#define GUI_SIG_ARM_RXD_L   0x6008
#define GUI_SIG_ARM_RYI_L   0x6009
#define GUI_SIG_ARM_RYD_L   0x600A
#define GUI_SIG_ARM_RZI_L   0x600B
#define GUI_SIG_ARM_RZD_L   0x600C
#define GUI_SIG_ARM_L_INI   GUI_SIG_ARM_XI_L
#define GUI_SIG_ARM_L_END   GUI_SIG_ARM_RZD_L

#define GUI_SIG_ARM_XI_R    0x7001
#define GUI_SIG_ARM_XD_R    0x7002
#define GUI_SIG_ARM_YI_R    0x7003
#define GUI_SIG_ARM_YD_R    0x7004
#define GUI_SIG_ARM_ZI_R    0x7005
#define GUI_SIG_ARM_ZD_R    0x7006
#define GUI_SIG_ARM_RXI_R   0x7007
#define GUI_SIG_ARM_RXD_R   0x7008
#define GUI_SIG_ARM_RYI_R   0x7009
#define GUI_SIG_ARM_RYD_R   0x700A
#define GUI_SIG_ARM_RZI_R   0x700B
#define GUI_SIG_ARM_RZD_R   0x700C
#define GUI_SIG_ARM_R_INI   GUI_SIG_ARM_XI_R
#define GUI_SIG_ARM_R_END   GUI_SIG_ARM_RZD_R

#define BOARD_SIG_TEST  0x8001

class CommSignal:public QObject
{
    Q_OBJECT

public:
    CommSignal(QObject * parent) : QObject(parent)
    {

    }

    void send(int sig)
    {
        emit commSignal(sig);
    }

signals:
    void commSignal(int v);
};

#endif // COMMSIGNAL_H
